home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -seriously_amiga- / programming / other / gtlayout / source / ltp_renderarrow.c < prev    next >
C/C++ Source or Header  |  1999-04-19  |  696b  |  42 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1998 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. #include "Assert.h"
  15.  
  16. #ifdef DO_TAPEDECK_KIND    /* Support code */
  17.  
  18. VOID
  19. LTP_RenderArrow(struct RastPort *RPort,BOOL LeftDirection,LONG Left,LONG Top,LONG Width,LONG Height)
  20. {
  21.     LONG i,Len,Start,Pos;
  22.  
  23.     for(i = 0 ; i < Width ; i++)
  24.     {
  25.         Len = ((Height * (i + 1)) / Width) & ~1;
  26.  
  27.         if(Len < Height)
  28.             Len++;
  29.  
  30.         Start = Top + (Height - Len) / 2;
  31.  
  32.         if(LeftDirection)
  33.             Pos = Left + i;
  34.         else
  35.             Pos = Left + Width - 1 - i;
  36.  
  37.         LTP_DrawLine(RPort,Pos,Start,Pos,Start + Len - 1);
  38.     }
  39. }
  40.  
  41. #endif    /* DO_TAPEDECK_KIND */
  42.